using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._DataComparison
{
    /// <summary>
    /// <para>Feature Compare</para>
    /// <para>Compares two feature classes or layers and returns the comparison results.</para>
    /// <para>比较两个要素类或图层并返回比较结果。</para>
    /// </summary>    
    [DisplayName("Feature Compare")]
    public class FeatureCompare : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FeatureCompare()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_base_features">
        /// <para>Input Base Features</para>
        /// <para>The Input Base Features are compared with the Input Test Features. Input Base Features refers to data that you have declared valid. This base data has the correct geometry definitions, field definitions, and spatial reference.</para>
        /// <para>将输入基础特征与输入测试特征进行比较。输入基本要素是指已声明有效的数据。此基础数据具有正确的几何定义、字段定义和空间参考。</para>
        /// </param>
        /// <param name="_in_test_features">
        /// <para>Input Test Features</para>
        /// <para>The Input Test Features are compared against the Input Base Features. Input Test Features refers to data that you have made changes to by editing or compiling new features.</para>
        /// <para>将输入测试特征与输入基础特征进行比较。输入测试要素是指通过编辑或编译新要素而进行更改的数据。</para>
        /// </param>
        /// <param name="_sort_field">
        /// <para>Sort Field</para>
        /// <para>The field or fields used to sort records in the Input Base Features and the Input Test Features. The records are sorted in ascending order. Sorting by a common field in both the Input Base Features and the Input Test Features ensures that you are comparing the same row from each input dataset.</para>
        /// <para>用于对输入基础要素和输入测试要素中的记录进行排序的一个或多个字段。记录按升序排序。按输入基础要素和输入测试要素中的公共字段进行排序可确保比较每个输入数据集中的同一行。</para>
        /// </param>
        public FeatureCompare(object _in_base_features, object _in_test_features, object _sort_field)
        {
            this._in_base_features = _in_base_features;
            this._in_test_features = _in_test_features;
            this._sort_field = _sort_field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Feature Compare";

        public override string CallName => "management.FeatureCompare";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_base_features, _in_test_features, _sort_field, _compare_type.GetGPValue(), _ignore_options, _xy_tolerance, _m_tolerance, _z_tolerance, _attribute_tolerances, _omit_field, _continue_compare.GetGPValue(), _out_compare_file, _compare_status.GetGPValue()];

        /// <summary>
        /// <para>Input Base Features</para>
        /// <para>The Input Base Features are compared with the Input Test Features. Input Base Features refers to data that you have declared valid. This base data has the correct geometry definitions, field definitions, and spatial reference.</para>
        /// <para>将输入基础特征与输入测试特征进行比较。输入基本要素是指已声明有效的数据。此基础数据具有正确的几何定义、字段定义和空间参考。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Base Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_base_features { get; set; }


        /// <summary>
        /// <para>Input Test Features</para>
        /// <para>The Input Test Features are compared against the Input Base Features. Input Test Features refers to data that you have made changes to by editing or compiling new features.</para>
        /// <para>将输入测试特征与输入基础特征进行比较。输入测试要素是指通过编辑或编译新要素而进行更改的数据。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Test Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_test_features { get; set; }


        /// <summary>
        /// <para>Sort Field</para>
        /// <para>The field or fields used to sort records in the Input Base Features and the Input Test Features. The records are sorted in ascending order. Sorting by a common field in both the Input Base Features and the Input Test Features ensures that you are comparing the same row from each input dataset.</para>
        /// <para>用于对输入基础要素和输入测试要素中的记录进行排序的一个或多个字段。记录按升序排序。按输入基础要素和输入测试要素中的公共字段进行排序可确保比较每个输入数据集中的同一行。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sort Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _sort_field { get; set; }


        /// <summary>
        /// <para>Compare Type</para>
        /// <para><xdoc>
        ///   <para>The comparison type. The default is All, which will compare all properties of the features being compared.</para>
        ///   <bulletList>
        ///     <bullet_item>All—All properties of the feature classes will be compared. This is the default.</bullet_item><para/>
        ///     <bullet_item>Geometry only—Only the geometries of the feature classes will be compared.</bullet_item><para/>
        ///     <bullet_item>Attributes only—Only the attributes and their values will be compared.</bullet_item><para/>
        ///     <bullet_item>Schema only—Only the schema of the feature classes will be compared.</bullet_item><para/>
        ///     <bullet_item>Spatial Reference only—Only the spatial references of the two feature classes will be compared.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>比较类型。默认值为 All，它将比较要比较的要素的所有属性。</para>
        ///   <bulletList>
        ///     <bullet_item>全部—将比较要素类的所有属性。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>仅几何—仅比较要素类的几何。</bullet_item><para/>
        ///     <bullet_item>仅属性 - 仅比较属性及其值。</bullet_item><para/>
        ///     <bullet_item>仅方案 - 仅比较要素类的方案。</bullet_item><para/>
        ///     <bullet_item>仅空间参考 - 仅比较两个要素类的空间参考。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compare Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _compare_type_value _compare_type { get; set; } = _compare_type_value._ALL;

        public enum _compare_type_value
        {
            /// <summary>
            /// <para>All</para>
            /// <para>All—All properties of the feature classes will be compared. This is the default.</para>
            /// <para>全部—将比较要素类的所有属性。这是默认设置。</para>
            /// </summary>
            [Description("All")]
            [GPEnumValue("ALL")]
            _ALL,

            /// <summary>
            /// <para>Geometry only</para>
            /// <para>Geometry only—Only the geometries of the feature classes will be compared.</para>
            /// <para>仅几何—仅比较要素类的几何。</para>
            /// </summary>
            [Description("Geometry only")]
            [GPEnumValue("GEOMETRY_ONLY")]
            _GEOMETRY_ONLY,

            /// <summary>
            /// <para>Attributes only</para>
            /// <para>Attributes only—Only the attributes and their values will be compared.</para>
            /// <para>仅属性 - 仅比较属性及其值。</para>
            /// </summary>
            [Description("Attributes only")]
            [GPEnumValue("ATTRIBUTES_ONLY")]
            _ATTRIBUTES_ONLY,

            /// <summary>
            /// <para>Schema only</para>
            /// <para>Schema only—Only the schema of the feature classes will be compared.</para>
            /// <para>仅方案 - 仅比较要素类的方案。</para>
            /// </summary>
            [Description("Schema only")]
            [GPEnumValue("SCHEMA_ONLY")]
            _SCHEMA_ONLY,

            /// <summary>
            /// <para>Spatial Reference only</para>
            /// <para>Spatial Reference only—Only the spatial references of the two feature classes will be compared.</para>
            /// <para>仅空间参考 - 仅比较两个要素类的空间参考。</para>
            /// </summary>
            [Description("Spatial Reference only")]
            [GPEnumValue("SPATIAL_REFERENCE_ONLY")]
            _SPATIAL_REFERENCE_ONLY,

        }

        /// <summary>
        /// <para>Ignore Options</para>
        /// <para><xdoc>
        ///   <para>These properties will not be compared.</para>
        ///   <bulletList>
        ///     <bullet_item>Ignore Ms—Do not compare measure properties.</bullet_item><para/>
        ///     <bullet_item>Ignore Zs—Do not compare elevation properties.</bullet_item><para/>
        ///     <bullet_item>Ignore PointIDs—Do not compare point ID properties.</bullet_item><para/>
        ///     <bullet_item>Ignore extension properties—Do not compare extension properties.</bullet_item><para/>
        ///     <bullet_item>Ignore subtypes—Do not compare subtypes.</bullet_item><para/>
        ///     <bullet_item>Ignore relationship classes—Do not compare relationship classes.</bullet_item><para/>
        ///     <bullet_item>Ignore representation classes—Do not compare representation classes.</bullet_item><para/>
        ///     <bullet_item>Ignore field alias—Do not compare field aliases.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>不会比较这些属性。</para>
        ///   <bulletList>
        ///     <bullet_item>忽略 Ms—不比较度量属性。</bullet_item><para/>
        ///     <bullet_item>忽略 Zs - 不比较高程属性。</bullet_item><para/>
        ///     <bullet_item>忽略 PointID - 不比较点 ID 属性。</bullet_item><para/>
        ///     <bullet_item>忽略扩展属性 - 不比较扩展属性。</bullet_item><para/>
        ///     <bullet_item>忽略子类型 （Ignore subtypes） - 不比较子类型。</bullet_item><para/>
        ///     <bullet_item>忽略关系类 - 不比较关系类。</bullet_item><para/>
        ///     <bullet_item>忽略制图表达类 - 不比较制图表达类。</bullet_item><para/>
        ///     <bullet_item>忽略字段别名 - 不比较字段别名。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore Options")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _ignore_options { get; set; } = null;


        /// <summary>
        /// <para>XY Tolerance</para>
        /// <para>The distance that determines the range in which features are considered equal. To minimize error, the value you choose for the compare tolerance should be as small as possible. By default, the compare tolerance is the XY tolerance of the input base features.</para>
        /// <para>确定要素相等范围的距离。为了最大程度地减少误差，为比较公差选择的值应尽可能小。默认情况下，比较容差是输入基本要素的 XY 容差。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("XY Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _xy_tolerance { get; set; } = null;


        /// <summary>
        /// <para>M Tolerance</para>
        /// <para>The measure tolerance is the minimum distance between measures before they are considered equal.</para>
        /// <para>测量容差是测量值在被视为相等之前测量值之间的最小距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("M Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _m_tolerance { get; set; } = 0;


        /// <summary>
        /// <para>Z Tolerance</para>
        /// <para>The Z Tolerance is the minimum distance between z coordinates before they are considered equal.</para>
        /// <para>Z 公差是 z 坐标在被视为相等之前之间的最小距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _z_tolerance { get; set; } = 0;


        /// <summary>
        /// <para>Attribute Tolerance</para>
        /// <para>The numeric value that determines the range in which attribute values are considered equal. This only applies to numeric field types.</para>
        /// <para>确定将属性值视为相等的范围的数值。这仅适用于数值字段类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attribute Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _attribute_tolerances { get; set; } = null;


        /// <summary>
        /// <para>Omit Fields</para>
        /// <para>The field or fields that will be omitted during comparison. The field definitions and the tabular values for these fields will be ignored.</para>
        /// <para>在比较过程中将省略的一个或多个字段。这些字段的字段定义和表格值将被忽略。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Omit Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _omit_field { get; set; } = null;


        /// <summary>
        /// <para>Continue Comparison</para>
        /// <para><xdoc>
        ///   <para>Indicates whether to compare all properties after encountering the first mismatch.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Stops after encountering the first mismatch. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—Compares other properties after encountering the first mismatch.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指示在遇到第一个不匹配后是否比较所有属性。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 在遇到第一个不匹配后停止。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 （Checked） - 在遇到第一个不匹配后比较其他属性。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Continue Comparison")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _continue_compare_value _continue_compare { get; set; } = _continue_compare_value._false;

        public enum _continue_compare_value
        {
            /// <summary>
            /// <para>CONTINUE_COMPARE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CONTINUE_COMPARE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_CONTINUE_COMPARE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_CONTINUE_COMPARE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Compare File</para>
        /// <para><xdoc>
        ///   <para>This file will contain all similarities and differences between the Input Base Features and the Input Test Features. This file is a comma-delimited text file that can be viewed and used as a table in ArcGIS.</para>
        ///   <para>This file will contain all similarities and differences between the in_base_features and the in_test_features. This file is a comma-delimited text file that can be viewed and used as a table in ArcGIS.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>此文件将包含输入基础要素和输入测试要素之间的所有相似之处和不同之处。此文件是一个逗号分隔的文本文件，可在 ArcGIS 中作为表进行查看和使用。</para>
        ///   <para>此文件将包含in_base_features和in_test_features之间的所有相似之处和不同之处。此文件是一个逗号分隔的文本文件，可在 ArcGIS 中作为表进行查看和使用。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Compare File")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_compare_file { get; set; } = null;


        /// <summary>
        /// <para>Compare Status</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compare Status")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public _compare_status_value _compare_status { get; set; }

        public enum _compare_status_value
        {
            /// <summary>
            /// <para>NO_DIFFERENCES_FOUND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_DIFFERENCES_FOUND")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DIFFERENCES_FOUND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DIFFERENCES_FOUND")]
            [GPEnumValue("false")]
            _false,

        }

        public FeatureCompare SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}